package com.yhd.gmall.user.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yhd.gmall.model.user.UserAddress;
import com.yhd.gmall.user.mapper.UserAddressMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author yhd
 * @createtime 2020/9/30 10:07
 */
@Service
public class UserAddressService {

    @Autowired
    private UserAddressMapper userAddressMapper;

    public List<UserAddress> findUserAddressListByUserId(Long userId){
        QueryWrapper<UserAddress> wrapper = new QueryWrapper<>();
        wrapper.eq("user_id",userId);
        return userAddressMapper.selectList(wrapper);
    }
}
